package com.deyuanyun.pic.ctrl.controller.vo.defect;

import com.deyuanyun.pic.common.util.ObjectUtil;
import com.deyuanyun.pic.ctrl.controller.vo.DefaultCommand;
import com.deyuanyun.pic.ctrl.domain.RepairLeakagePoint;
import com.deyuanyun.pic.pbf.controller.dto.defect.ImgDto;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 漏损点测量 数据传输对象
 *
 * @author huanglw
 * @date 2016-9-27
 *
 * History: [修改人][时间][修改描述]
 */
public class RepairLeakagePointVO extends DefaultCommand<RepairLeakagePoint> {

    // 最大漏损点长度（mm）
    private BigDecimal maxLength;
    // 最大漏损点宽度（mm）
    private BigDecimal maxWidth;
    // 时钟位置
    private String clock;
    // 漏损点外观描述
    private String description;
    // 备注
    private String remarks;
    // 原因
    private String reason;
    // 照片
    private Map<String, List<ImgDto>> imgList;

    /**
     * 是否完成该节点任务：0，没有完成；1，已经完成
     */
    private Short isCompletion;

    public RepairLeakagePointVO(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public Short getIsCompletion() {
        return isCompletion;
    }

    public void setIsCompletion(Short isCompletion) {
        this.isCompletion = isCompletion;
    }

    public BigDecimal getMaxLength() {
        return maxLength;
    }

    public void setMaxLength(BigDecimal maxLength) {
        this.maxLength = maxLength;
    }

    public BigDecimal getMaxWidth() {
        return maxWidth;
    }

    public void setMaxWidth(BigDecimal maxWidth) {
        this.maxWidth = maxWidth;
    }

    public String getClock() {
        return clock;
    }

    public void setClock(String clock) {
        this.clock = clock;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public Map<String, List<ImgDto>> getImgList() {
        return imgList;
    }

    public void setImgList(Map<String, List<ImgDto>> imgList) {
        this.imgList = imgList;
    }

    public void fromDomain(RepairLeakagePoint domain) {

        if (ObjectUtil.isEmptyAll(domain)) {
            return;
        }

        // 最大漏损点长度（mm）
        this.maxLength = domain.getMaxLength();
        // 最大漏损点宽度（mm）
        this.maxWidth = domain.getMaxWidth();
        // 时钟位置
        this.clock = domain.getClock();
        // 漏损点外观描述
        this.description = domain.getDescription();
        // 备注
        this.remarks = domain.getRemarks();
        // 原因
        this.reason = domain.getReason();
        // 图片
        this.imgList = ImgDto.queryImgDtoMapList(domain.getId());
    }
}
